home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / Cookie / new-to-you.izs < prev    next >
Text File  |  2005-09-28  |  3KB  |  135 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>New to You 
  4. <!/TITLE>
  5.  
  6. <!DESCRIPTION>This scripts shows you how you can show your visitors whats new since they last visited!<!/DESCRIPTION> 
  7.  
  8. <!CATEGORY>cookies<!/CATEGORY>
  9.  
  10. <!SCRIPT>
  11. <!-- START OF SCRIPT -->
  12.  
  13. <!-- HOW TO INSTALL NEW TO YOU:
  14.  
  15.   1.  Copy code into the HEAD section of document
  16.   2.  Put last coding into the BODY section of document  -->
  17.  
  18. <!-- STEP ONE: Add code into HEAD section of document  -->
  19.  
  20. <HEAD>
  21.  
  22. <SCRIPT LANGUAGE="JavaScript">
  23.  
  24.  
  25. <!-- Begin
  26. now = new Date
  27. expireDate = new Date
  28. expireDate.setMonth(expireDate.getMonth()+6)
  29. lastVisit = new Date(cookieVal("pageVisit"))
  30. document.cookie = "pageVisit="+now+";expires=" + expireDate.toGMTString()
  31.  
  32. function cookieVal(cookieName) {
  33.   thisCookie = document.cookie.split("; ")
  34.     for (i=0; i<thisCookie.length; i++) {
  35.       if (cookieName == thisCookie[i].split("=")[0]) {
  36.         return thisCookie[i].split("=")[1]
  37.       }
  38.     }
  39.   return "1 January 1970"
  40. }
  41.  
  42. function newCheck(yyy,mm,dd) {
  43.   lastChgd = new Date(yyy,mm-1,dd)
  44.   if (lastChgd.getTime() > lastVisit.getTime()) {
  45.     document.write("<img src='/img/new-to-you/new.gif' alt='new'>")
  46.   }
  47. }
  48. //  End -->
  49.  
  50. </script>
  51.  
  52.  
  53. </HEAD>
  54.  
  55.  
  56. <!-- STEP TWO: Add code into BODY section of document  -->
  57.  
  58.  
  59. <BODY>
  60.  
  61. <p>
  62. <script type="text/javascript" language="JavaScript"> newCheck(2005,2,11)</script> Be sure to check out our new scripts!
  63. <br>
  64. <script type="text/javascript" language="JavaScript"> newCheck(2005,2,3)</script> Have you seen our Tutorials?
  65. </p>
  66.  
  67.  
  68.  
  69. <!-- END OF SCRIPT -->
  70. <!/SCRIPT>
  71.  
  72. <!PREVIEW>
  73. <!-- START OF SCRIPT -->
  74.  
  75.  
  76. <!-- HOW TO INSTALL NEW TO YOU:
  77.  
  78.   1.  Copy code into the HEAD section of document
  79.   2.  Put last coding into the BODY section of document  -->
  80.  
  81. <!-- STEP ONE: Add code into HEAD section of document  -->
  82.  
  83. <HEAD>
  84.  
  85. <SCRIPT LANGUAGE="JavaScript">
  86.  
  87.  
  88. <!-- Begin
  89. now = new Date
  90. expireDate = new Date
  91. expireDate.setMonth(expireDate.getMonth()+6)
  92. lastVisit = new Date(cookieVal("pageVisit"))
  93. document.cookie = "pageVisit="+now+";expires=" + expireDate.toGMTString()
  94.  
  95. function cookieVal(cookieName) {
  96.   thisCookie = document.cookie.split("; ")
  97.     for (i=0; i<thisCookie.length; i++) {
  98.       if (cookieName == thisCookie[i].split("=")[0]) {
  99.         return thisCookie[i].split("=")[1]
  100.       }
  101.     }
  102.   return "1 January 1970"
  103. }
  104.  
  105. function newCheck(yyy,mm,dd) {
  106.   lastChgd = new Date(yyy,mm-1,dd)
  107.   if (lastChgd.getTime() > lastVisit.getTime()) {
  108.     document.write("<img src='/img/new-to-you/new.gif' alt='new'>")
  109.   }
  110. }
  111. //  End -->
  112.  
  113. </script>
  114.  
  115.  
  116. </HEAD>
  117.  
  118.  
  119. <!-- STEP TWO: Add code into BODY section of document  -->
  120.  
  121.  
  122. <BODY>
  123.  
  124. <p>
  125. <script type="text/javascript" language="JavaScript"> newCheck(2005,2,11)</script> Be sure to check out our new scripts!
  126. <br>
  127. <script type="text/javascript" language="JavaScript"> newCheck(2005,2,3)</script> Have you seen our Tutorials?
  128. </p>
  129.  
  130.  
  131. <!-- END OF SCRIPT -->
  132. <!/PREVIEW>
  133.  
  134. <!RELATED>new.gif<!/RELATED>
  135.